<div id="content">
    <div id="page-heading"><h1>Thông tin tài khoản quản trị</h1></div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized"><img src="<?= base_url(); ?>images/admin_img/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
            <th class="topleft"></th>
            <td id="tbl-border-top">&nbsp;</td>
            <th class="topright"></th>
            <th rowspan="3" class="sized"><img src="<?= base_url(); ?>images/admin_img/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
        </tr>
        <tr>
            <td id="tbl-border-left"></td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <div id="table-content">
                        <div class="warning"><? if ($this->session->flashdata("warning")) echo $this->session->flashdata("warning"); ?></div>
                        <div id="admin_infor_left">
                            <div id="admin_infor">
                                <? if ($infor): ?>
                                    <table style="width: 80%;">
                                        <tr class="row_head" style="border-bottom: 2px solid #272727;">
                                            <th style="text-align: left;">Xin chào <?= $infor->AdminUser; ?>!</th>
                                        </tr>
                                        <tr>
                                            <td>Họ và tên: </td>
                                            <td><?= $infor->AdminName; ?></td>
                                        </tr>
                                        <tr>
                                            <td>Email: </td>
                                            <td><?= $infor->AdminEmail; ?></td>
                                        </tr>
                                    </table>
                                <? endif; ?>
                            </div>
                            <div id="ECC">
                                <ul>
                                    <li><a href="<?= base_url() ?>dienhoa-administrator/account/form_edit_acc">Sửa thông tin</a></li>
                                    <? if ($checkAdmin == "admin"): ?>
                                        <li>|</li>
                                        <li><a href="<?= base_url() ?>dienhoa-administrator/account/form_creat_acc">Tạo tài khoản</a></li>
                                        <li>|</li>
                                        <li><a href="<?= base_url() ?>dienhoa-administrator/account/form_creat_group">Tạo nhóm tài khoản</a></li>
                                    <? endif; ?>
                                </ul>
                            </div>
                        </div>
                        <div id="admin_infor_right">
                            <div id="list_account">
                                <? if ($checkAdmin == "admin"): ?>
                                    <? if ($mod): ?>
                                        <fieldset>
                                            <legend><h2>Danh sách account quản trị</h2></legend>
                                            <table class="table_infor_acc">
                                                <thead>
                                                    <tr>
                                                        <th>Họ & Tên</th>
                                                        <th>Tên tài khoản</th>
                                                        <th>Chức vụ</th>
                                                        <th>Trạng thái</th>
                                                        <th>Tùy chọn</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <? foreach ($mod as $rows): ?>
                                                        <tr>
                                                            <td><? echo $rows->AdminName; ?></td>
                                                            <td><? echo $rows->AdminUser; ?></td>
                                                            <td>
                                                                <select name="optGroup" class="opt" onchange="window.location ='<?= base_url();?>dienhoa-administrator/account/edit_group_for_acc/<?= $rows->AdminID?>/'+this.value; ">
                                                                    <? if ($nhom): ?>
                                                                        <? foreach ($nhom as $n): ?>
                                                                            <option value="<?= $n["groupID"] ?>" <? if ($n["groupID"] == $rows->admin_group_id) echo "selected"; ?>><?= $n["groupName"]; ?></option>
                                                                        <? endforeach; ?>
                                                                    <? endif; ?>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                <select name="status" class="opt">
                                                                    <option <? if ($rows->AdminStatus == 0) echo "selected='selected'" ?> value="0">Được dùng</option>
                                                                    <option <? if ($rows->AdminStatus == 1) echo "selected=''" ?> value="1">tạm khóa</option>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                <a class="icon-2 infor-tooltip" title="Xóa" href="<?= base_url() ?>admin/account/deleteAcc/<?= $rows->AdminID; ?>"></a>
                                                            </td>
                                                        </tr>
                                                    <? endforeach; ?>
                                                </tbody>
                                            </table>
                                        </fieldset>
                                    <? endif; ?>
                                    <fieldset>
                                        <legend><h2>Danh sách nhóm quản trị</h2></legend>
                                        <table class="table_infor_acc">
                                            <thead>
                                                <tr>
                                                    <th>Tên nhóm</th>
                                                    <th>Tùy chọn</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <? if ($nhom): ?>
                                                    <? foreach ($nhom as $n): ?>
                                                        <tr class="sp">
                                                            <td ><?= $n["groupName"]; ?></td>
                                                            <td ><a class="icon-1" href="<?= base_url(); ?>dienhoa-administrator/account/form_edit_group/<?= $n['groupID'] ?>"></a> <a class="icon-2" href="<?= base_url(); ?>admin/account/deleteGroup/<?= $n['groupID']; ?>" title="xóa nhóm"></a></td>
                                                        </tr>
                                                    <? endforeach; ?>
                                                <? endif; ?>
                                            </tbody>
                                        </table>
                                    </fieldset>
                                <? endif; ?>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right"></td>
        </tr>
        <tr>
            <th class="sized bottomleft"></th>
            <td id="tbl-border-bottom">&nbsp;</td>
            <th class="sized bottomright"></th>
        </tr>
    </table>

    <div class="clear">&nbsp;</div>

</div>

